<template>
  <nav class="navbar navbar-expand-lg bg-body-tertiary">
    <div class="container-fluid">
      <a class="navbar-brand" href="#">Navbar</a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <dropdown :title="user.name">
        <dropdown-item><a class="dropdown-item" href="#">新建文章</a></dropdown-item>
        <dropdown-item disabled ><a class="dropdown-item " href="#">编辑资料</a></dropdown-item>
        <dropdown-item><a class="dropdown-item" href="#">退出登陆</a></dropdown-item>
      </dropdown>
    </div>
  </nav>
</template>
<script lang="ts">
import {defineComponent, PropType} from "vue";
import Dropdown from "./Dropdown.vue";
import DropdownItem from "./DropdownItem.vue";
export interface UserProps {
  isLogin: boolean
  name?: string,
  id?: number
}
export default defineComponent({
  name:'GlobalHeader',
  components: {Dropdown,DropdownItem},
  props:{
    user: {
      type: Object as PropType<UserProps>,
    }
  }
})
</script>

